num = int(input("请输入循环次数"))
# 定义从什么时候循环
i = 0
while i < num:
    # 打印
    print(i)
    # 从新赋值
    i = i + 1
print("循环结束i的值是 %d" % i)

# 循环计算
sum = 0
j = 0
while j <= 100000:
    sum += j
    j += 1
print("总和是%d" % sum)

# 偶数求和
result = 0
i = 0
while i <= 100:
    if i % 2 == 0:
        result += i
    i += 1
print("0-100之间的偶数和是 %d" % result)
